package com.zb777.shuzhilingxi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb777.shuzhilingxi.Pojo.entity.ChatHistoryDetail;
import com.zb777.shuzhilingxi.mapper.ChatHistoryDetailMapper;

import com.zb777.shuzhilingxi.service.IChatHistoryDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChatHistoryDetailServiceImpl extends ServiceImpl<ChatHistoryDetailMapper, ChatHistoryDetail> implements IChatHistoryDetailService {

    @Override
    public List<ChatHistoryDetail> getByChatHistoryListId(Integer chatHistoryListId) {
        return baseMapper.selectByChatHistoryListId(chatHistoryListId);
    }

    @Override
    public void deleteByChatHistoryListId(Integer chatHistoryListId) {
        LambdaQueryWrapper<ChatHistoryDetail> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ChatHistoryDetail::getChatHistoryListId, chatHistoryListId);
        baseMapper.delete(queryWrapper);
    }
}